package com.ntschy.common.valid.phone;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 *  自定义手机号校验注解
 *  @author ezreal_geng
 */
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy = { PhoneValidation.class })
public @interface Phone {

    String message() default "手机号格式错误";

    /* 是否可以为 null */
    boolean must() default false;

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
